<?php

Route::post('/login', 'LoginController@login');


// 材料父类

Route::group(['middleware' => ['auth:administrator', 'backend.permission']], function () {
    Route::get('/user', 'LoginController@user');
    Route::get('/menus', 'LoginController@menus');

    // 图片上传
    Route::post('/upload/image', 'UploadController@imageUpload');
    // 前端直传，扮演oss角色返回身份信息
    Route::get('/upload/assumeRole', 'UploadController@assumeRole');

    Route::get('/dashboard', 'DashboardController@index');
    Route::get('/dashboard/check', 'DashboardController@check');
    Route::get('/dashboard/system/info', 'DashboardController@systemInfo');

    // 管理员
    Route::group(['prefix' => 'administrator'], function () {
        Route::put('/password', 'AdministratorController@editPasswordHandle');
        Route::get('/', 'AdministratorController@index');
        Route::get('/create', 'AdministratorController@create');
        Route::post('/', 'AdministratorController@store');
        Route::get('/{id}', 'AdministratorController@edit');
        Route::put('/{id}', 'AdministratorController@update');
        Route::delete('/{id}', 'AdministratorController@destroy');
    });

    // 权限
    Route::group(['prefix' => 'administrator_permission'], function () {
        Route::get('/', 'AdministratorPermissionController@index');
    });

    // 角色
    Route::group(['prefix' => 'administrator_role'], function () {
        Route::get('/', 'AdministratorRoleController@index');
        Route::get('/create', 'AdministratorRoleController@create');
        Route::post('/', 'AdministratorRoleController@store');
        Route::get('/{id}', 'AdministratorRoleController@edit');
        Route::put('/{id}', 'AdministratorRoleController@update');
        Route::delete('/{id}', 'AdministratorRoleController@destroy');
    });

    // 网站配置
    Route::group(['prefix' => 'setting'], function () {
        Route::get('/', 'SettingController@index');
        Route::post('/', 'SettingController@saveHandler');
    });

    // banner
    Route::group(['prefix' => 'banner_serve'], function () {
        Route::get('/', 'BannerController@index');
        Route::get('/create', 'BannerController@create');
        Route::post('/', 'BannerController@store');
        Route::get('/{id}', 'BannerController@edit');
        Route::put('/{id}', 'BannerController@update');
        Route::delete('/{id}', 'BannerController@destroy');
    });
    // 经典案例
    Route::group(['prefix' => 'classic_case_serve'], function () {
        Route::get('/', 'ClassicCaseController@index');
        Route::post('/', 'ClassicCaseController@store');
        Route::get('/create', 'ClassicCaseController@create');
        Route::get('/{id}', 'ClassicCaseController@edit');
        Route::put('/{id}', 'ClassicCaseController@update');
        Route::delete('/{id}', 'ClassicCaseController@destroy');
    });
    // 720全景图库管理
    Route::group(['prefix' => 'space_scheme_serve'], function () {
        Route::get('/', 'SpaceSchemeController@index');
        Route::post('/', 'SpaceSchemeController@store');
        Route::get('/create', 'SpaceSchemeController@create');
        Route::get('/{id}', 'SpaceSchemeController@edit');
        Route::get('/relevancy/{id}', 'SpaceSchemeController@relevancyindex');
        Route::put('/{id}', 'SpaceSchemeController@update');
        Route::delete('/{id}', 'SpaceSchemeController@destroy');
    });
    // 720全景图库内容类别
    Route::group(['prefix' => 'space_scheme_content_category'], function () {
        Route::post('/', 'SpaceSchemeContentCategoryController@store');
        Route::get('/{id}', 'SpaceSchemeContentCategoryController@edit');
        Route::get('/content/{id}', 'SpaceSchemeContentCategoryController@contentedit');
        Route::put('/{id}', 'SpaceSchemeContentCategoryController@update');
        Route::delete('/{id}', 'SpaceSchemeContentCategoryController@destroy');
    });
    // 720全景图库内容
    Route::group(['prefix' => 'space_scheme_content'], function () {
        Route::get('/', 'SpaceSchemeContentController@index');
        Route::post('/', 'SpaceSchemeContentController@store');
        Route::get('/{id}', 'SpaceSchemeContentController@edit');
        Route::put('/{id}', 'SpaceSchemeContentController@update');
        Route::delete('/{id}', 'SpaceSchemeContentController@destroy');
    });
    // banner
    Route::group(['prefix' => 'designer_serve'], function () {
        Route::get('/', 'DesignerController@index');
        Route::get('/create', 'DesignerController@create');
        Route::post('/', 'DesignerController@store');
        Route::get('/{id}', 'DesignerController@edit');
        Route::put('/{id}', 'DesignerController@update');
        Route::delete('/{id}', 'DesignerController@destroy');
    });

});
